package ch7.innerscopes;

/**
 * @author ANG.YU
 * @date 2020-08-13 19:28
 * 在任意作用域内嵌套一个类
 */
public class Parcel5 {
    public static void main(String[] args) {
        Parcel5 p = new Parcel5();
        p.track();
    }

    private void internalTracking(boolean b) {
        if (b) {
            class TrackingShip {
                private String id;

                public TrackingShip(String id) {
                    this.id = id;
                }

                String getSlip() {
                    return id;
                }
            }
        }
    }

    public void track() {
        internalTracking(true);
    }
}
